package com.briup.MR.Sort.normal;


import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

/**
 * TODO
 *
 * @author 最美如初
 * @version 1.0
 * @date 2021/7/24
 * @description
 */
public class DescSort extends WritableComparator {
    //告诉Mapreduce参与比较的键类型
    public DescSort(){
        super(Text.class,true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        Text x= (Text) a;
        Text y= (Text) b;
        return x.toString().compareTo(y.toString());
    }
}
